import { OnInit, Component, ViewChild } from '@angular/core';
import { StudentScoreListComponent } from './student-score-list.component';
import { SettingsService } from '@delon/theme';

@Component({
  selector: 'app-student-score-view',
  templateUrl: './student-score-view.component.html',
  styles: [],
})
export class StudentScoreViewComponent implements OnInit {
  constructor(private settingService: SettingsService) {}

  @ViewChild('studentScoreListComponent', { static: false })
  studentScoreListComponent: StudentScoreListComponent;

  /**
   * 条件查询参数
   */
  queryParams = {
    year: null,
    termType: null,
    code: null,
  };

  /**
   * 查询
   */
  search() {
    this.studentScoreListComponent.loadData();
  }

  /**
   * 刷新
   */
  reflesh() {
    this.studentScoreListComponent.loadData();
  }

  /**
   * 重置表单
   */
  reset() {
    this.queryParams.year = null;
    this.queryParams.termType = null;
  }

  ngOnInit() {
    this.queryParams.code = this.settingService.user.code;
  }
}
